using UnityEngine;

public abstract class MyAnimator : MonoBehaviour
{
    protected Animator animator;
    public AnimatorStateInfo CurrentInfo => animator.GetCurrentAnimatorStateInfo(0);
    public int CurrentID => CurrentInfo.shortNameHash;

    protected virtual void Awake()
    {
        animator = GetComponent<Animator>();
    }
    protected virtual void Update()
    {

    }

    public bool CurrentTagMatch(params string[] tags)
    {
        foreach (string tag in tags)
        {
            if (CurrentInfo.tagHash == Animator.StringToHash(tag))
                return true;
        }
        return false;
    }
    public bool CurrentTagMatch(params int[] ids)
    {
        foreach (int id in ids)
        {
            if (CurrentInfo.tagHash == id)
                return true;
        }
        return false;
    }
}
